import baseRouter from './baseRouter'
import { createRouter, createWebHashHistory } from 'vue-router'

// 修复首次路径跳转报错 改写push方法
const originalPush = createRouter.prototype.push
createRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}
const router = createRouter({
  history: createWebHashHistory(import.meta.env.VITE_BASE_URL),
  routes: baseRouter,
})

export default router
